GNFORCEINLINE guint GnApp::GetMenuID()
{
	return mpAppWindow->GetMenuID();
}
GNFORCEINLINE void GnApp::SetOSInstance(GnInstance& instance)
{
	msWindowInstance = instance;
}

GNFORCEINLINE  GnAppWindow* GnApp::GetAppWindow()
{
	return mpAppWindow;
}

inline void GnApp::ResetTimes()
{
	mCurrentTime = 0.0f;
	mLastTime = 0.0f;
	mAccumTime = 0.0f;
	mFrameTime = 0.0f;
	mClicks = 1;
	mFrameRate = 0.0f;

	mMinFramePeriod = 1.0f / 100.0f;
	mLastFrame = 0.0f;

	mBeginUpdateTime = 0.0f;
	mUpdateTime = 0.0f;

	mBeginCullTime = 0.0f;
	mCullTime = 0.0f;

	mBeginRenderTime = 0.0f;
	mRenderTime = 0.0f;
}

inline void GnApp::ResetFrameTimes()
{
	mUpdateTime = 0.0f;
	mCullTime = 0.0f;
	mRenderTime = 0.0f;
}

inline void GnApp::BeginUpdate()
{
	GnAssert(mBeginUpdateTime == 0.0f);
	mBeginUpdateTime = GnGetCurrentTimeInSec();
}

inline void GnApp::EndUpdate()
{
	float fEndUpdate = GnGetCurrentTimeInSec();
	mUpdateTime += fEndUpdate - mBeginUpdateTime;
	mBeginUpdateTime = 0.0f;
}

inline void GnApp::BeginCull()
{
	GnAssert(mBeginCullTime == 0.0f);
	mBeginCullTime = GnGetCurrentTimeInSec();
}

inline void GnApp::EndCull()
{
	float fEndCull = GnGetCurrentTimeInSec();
	mCullTime += fEndCull - mBeginCullTime;
	mBeginCullTime = 0.0f;
}

inline void GnApp::BeginFrame()
{
	GnAssert(mBeginRenderTime == 0.0f);
	mBeginRenderTime = GnGetCurrentTimeInSec();
}

inline void GnApp::EndFrame()
{
	float fEndRender = GnGetCurrentTimeInSec();
	mRenderTime += fEndRender - mBeginRenderTime;
	mBeginRenderTime = 0.0f;
}
